/*
 * Created on Jan 16, 2005
 *
 * TODO To change the template for this generated file go to
 * Window - Preferences - Java - Code Style - Code Templates
 */
package org.scohen.juploadr.uploadapi.zooomr.upload;

import org.scohen.juploadr.uploadapi.zooomr.DefaultZooomrHandler;
import org.xml.sax.SAXException;

/**
 * @author steve
 * 
 * TODO To change the template for this generated type comment go to Window -
 * Preferences - Java - Code Style - Code Templates
 */
public class ZooomrUploadResponseHandler extends DefaultZooomrHandler {
    private String photoID;
    private String status;
    private String verbose;
    private int errorCode;
    public ZooomrUploadResponseHandler(Object parent) {
        super(parent);
    }

    /*
     * (non-Javadoc)
     * 
     * @see org.xml.sax.ContentHandler#characters(char[], int, int)
     */
    public void characters(char[] chars, int start, int end)
            throws SAXException {
        super.characters(chars, start, end);

        String cdata = new String(chars, start, end).trim();
        if (cdata.length() > 0) {
            if ("status".equals(lastTag)) {
                status = cdata;
            } else if ("photoid".equals(lastTag)) {
                photoID = cdata;
            } else if ("error".equals(lastTag)) {
                errorCode = Integer.parseInt(cdata);
            } else if ("verbose".equals(lastTag)) {
                verbose = cdata;
            }
        }
    }

    /**
     * @return Returns the errorCode.
     */
    public int getErrorCode() {
        return errorCode;
    }

    /**
     * @param errorCode
     *            The errorCode to set.
     */
    public void setErrorCode(int errorCode) {
        this.errorCode = errorCode;
    }

    /**
     * @return Returns the photoID.
     */
    public String getPhotoID() {
        return photoID;
    }

    /**
     * @param photoID
     *            The photoID to set.
     */
    public void setPhotoID(String photoID) {
        this.photoID = photoID;
    }

    /**
     * @return Returns the status.
     */
    public String getStatus() {
        return status;
    }

    /**
     * @param status
     *            The status to set.
     */
    public void setStatus(String status) {
        this.status = status;
    }

    /**
     * @return Returns the verbose.
     */
    public String getVerbose() {
        return verbose;
    }

    /**
     * @param verbose
     *            The verbose to set.
     */
    public void setVerbose(String verbose) {
        this.verbose = verbose;
    }
}
